<!-- angular通过ng-modal添加模态框时，不需要外层的div，只需从modal-content开始即可 -->
<style>
    .tree-control .tree-input { width: 100%; }
</style>
<div class="modal-content">
    <div class="modal-header">
        <h3 class="modal-title">{{flowTypeName}}</h3>
    </div>
    <div class="modal-body" ng-show="isUserManualGuide">
        <div style="margin-bottom: 10px;">
            <m-ui-select prompt="请选择系统"
                         itme-list="sysArray"
                         selected-item="sltSysItem"
                         select-item-fun="switchSys(item)">
            </m-ui-select>
        </div>
        <div>
            <m-ui-select prompt="请选择功能点"
                         itme-list="ffDataArray"
                         selected-item="sltLegendItem">
            </m-ui-select>
        </div>
    </div>
    <div class="modal-body" ng-show="isAddFeatureOrFlow && !isUserManualGuide">
        <div style="margin-bottom: 10px;">
            <div class="col-sm-6">
                <div class="radio">
                    <label class="i-checks" ng-click="switchRadio('select')">
                        <input type="radio" name="a" value="select" checked="">
                        <i></i> 选择已存在
                    </label>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="radio">
                    <label class="i-checks" ng-click="switchRadio('new')">
                        <input type="radio" name="a" value="new">
                        <i></i> 新建
                    </label>
                </div>
            </div>
        </div>
        <div ng-show="currentRadio == 'select'">
            <div style="margin-bottom: 10px;" ng-if="type == 'Feature'">
                <m-ui-select prompt="请选择功能点类型"
                             itme-list="featureKindArray"
                             selected-item="sltKindItem"
                             select-item-fun="switchKind(item)">
                </m-ui-select>
            </div>
            <div style="margin-bottom: 10px;" ng-if="type == 'Feature'">
                <m-ui-select prompt="请选择系统"
                             itme-list="sysArray"
                             selected-item="sltSysItem"
                             select-item-fun="switchSys(item)">
                </m-ui-select>
            </div>
            <div id="showLoading">
                <i class="fa fa-spinner fa-spin fa-2x fa-fw" style="color: rgb(109, 106, 106);"></i>
            </div>
            <div id="showList" style="display: none;">
                <m-ui-select prompt="{{promptName}}"
                             itme-list="ffDataArray"
                             selected-item="sltLegendItem">
                </m-ui-select>
            </div>
        </div>
        <form class="form-horizontal" ng-show="currentRadio == 'new'">
            <div class="form-group" style="margin-bottom: 10px;" ng-hide="hideIsMaster">
                <div class="col-sm-6" ng-if="type == 'Feature'">
                    <div class="radio">
                        <label class="i-checks" ng-click="switchMasterOrReq('master')">
                            <input type="radio" name="a" value="select" checked="">
                            <i></i> 这是已经上线的旧功能，仅维护知识库
                        </label>
                    </div>
                </div>
                <div class="col-sm-6" ng-if="type == 'Feature'">
                    <div class="radio">
                        <label class="i-checks" ng-click="switchMasterOrReq('req')">
                            <input type="radio" name="a" value="new">
                            <i></i> 这是新设计的功能
                        </label>
                    </div>
                </div>
            </div>
            <div style="margin-bottom: 10px;" ng-if="type == 'Feature'">
                <m-ui-select prompt="请选择功能点类型"
                             itme-list="featureKindArray"
                             selected-item="sltKindItem"
                             select-item-fun="switchKind(item)">
                </m-ui-select>
            </div>
            <div style="margin-bottom: 10px;" ng-if="type == 'Feature'">
                <m-ui-select prompt="请选择系统"
                             itme-list="sysArray"
                             selected-item="sltSysItem"
                             select-item-fun="switchSys(item)">
                </m-ui-select>
            </div>
            <div id="showNewLoading">
                <i class="fa fa-spinner fa-spin fa-2x fa-fw" style="color: rgb(109, 106, 106);"></i>
            </div>
            <div id="newFeatureTree" style="display: none;">
                <multi-select-tree data-input-model="treeData"
                                   multi-select="false"
                                   data-add-item="false"
                                   data-default-label="请选择父节点"
                                   data-callback="selectProductLine(item, selectedItems)"
                                   data-select-only-leafs="false">
                </multi-select-tree>
            </div>
            <div class="form-group" style="margin-top: 10px;">
                <div class="col-sm-12">
                    <input type="text" class="form-control" placeholder="请输入名称..." ng-model="addFeatureOrFlowName" required>
                </div>
            </div>
        </form>

    </div>
    <form name="form" class="modal-body form-horizontal" ng-show="!isAddFeatureOrFlow && !isUserManualGuide">
        <div class="form-group">
            <label class="col-sm-2 control-label">名称：</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" placeholder="请输入名称..." ng-model="flowName" ng-disabled="flowType == 'move'" required>
            </div>
        </div>
        <div class="line-lg pull-in" ng-show="flowType == 'copy'"></div>
        <div class="form-group" ng-show="flowType == 'copy'">
            <label class="col-sm-2 control-label">复制到：</label>
            <div class="col-sm-10">
                <multi-select-tree data-input-model="treeData"
                                    multi-select="false"
                                    data-add-item="false"
                                    data-crt-value="{{dataCrtValue}}"
                                    data-default-label="请选择节点"
                                    data-callback="selectProductLine(item, selectedItems)"
                                    data-select-only-leafs="false">
                </multi-select-tree>
            </div>
        </div>
        <div class="line-lg pull-in" ng-show="flowType == 'move'"></div>
        <div class="form-group" ng-show="flowType == 'move'">
            <label class="col-sm-2 control-label">移动到：</label>
            <div class="col-sm-10">
                <m-ui-select prompt="请选择要移动到的架构名称"
                             itme-list="originData"
                             selected-item="sltFrameItem">
                </m-ui-select>
            </div>
        </div>
    </form>
    <div class="modal-footer">
        <button type="button" class="btn btn-primary" ng-click="createClick()" ng-show="isUserManualGuide">确定</button>
        <button type="button" class="btn btn-primary" ng-click="createClick()" ng-show="isAddFeatureOrFlow && !isUserManualGuide">确定</button>
        <button type="button" class="btn btn-primary" ng-click="createClick()" ng-disabled="form.$invalid" ng-show="!isAddFeatureOrFlow && !isUserManualGuide">确定</button>
        <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="cancelClick()">取消</button>
    </div>
</div>
